package com.indusfo.spc.controller;



import com.indusfo.spc.pojo.Dep;
import com.indusfo.spc.service.DepService;
import com.indusfo.spc.vo.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;


//部门控制层
@Controller
@RequestMapping(value = "/dep")
public class DepController {


    @Autowired
    private DepService deptService;

    //增加修改
    @RequestMapping(value = "/creatDepts")
    @ResponseBody
    public JSONObject creatDepts(Dep dep) {
        JSONObject json = deptService.creatDepts(dep);
        return json;

    }


    //查询
    @RequestMapping(value = "/lookDepts")
    @ResponseBody
    public JSONObject lookDepts(Dep dep) {
        JSONObject json = deptService.lookDepts(dep);
        return json;

    }


    //删除
    @RequestMapping(value = "/deleteDepts")
    @ResponseBody
    public JSONObject deleteDepts(Dep dep) {
        JSONObject json = deptService.deleteDepts(dep);
        return json;

    }



     //树
    @RequestMapping(value = "/detpsTree")
    @ResponseBody
    public JSONObject detpsTree(Dep dep) {
        JSONObject json = deptService.detpsTree(dep);
        return json;
    }

}
